import Vue from 'vue'
import App from './App.vue'
import router from './router'

//引入Vuex
import Vuex from 'vuex'
import store from "./common/store/index.js"
//引入多语言
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)

const i18n=new VueI18n({
  locale: localStorage.getItem('locale') || 'zh',
  //this.$i18n.locale // 通过切换locale的值来实现语言切换
  messages: {//引入语言包
    'zh': require('./lang/zh'),   // 中文语言包
    'en': require('./lang/en'),    // 英文语言包
    'ja': require('./lang/ja'),    // 日文语言包
  }
})

// 引入推送接口等等
import svcInvoke from "./common/svcinvoke"
Vue.use(svcInvoke, 'https://www.turirute.xyz/api/', {});

import socket from './common/websocket.js';
Vue.use(socket, 'wss://www.turirute.xyz/wss');
// Vue.use(socket, 'ws://27.50.54.8:30001');


import layer from 'vue-layer'
import 'vue-layer/lib/vue-layer.css';
Vue.prototype.$layer = layer(Vue);

//Element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);


//引入分隔面板
import splitPane from 'vue-splitpane';
// use as global component
Vue.component('split-pane', splitPane);
// 引入k线相关

import * as echarts from 'echarts';
import jquery from 'jquery';
import Kline from 'kline';

Vue.prototype.$kline = Kline;
Vue.prototype.echarts = echarts;

window.$ = jquery;

Vue.prototype.$store = store;

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
